<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册您的账号</title>
    <link rel="stylesheet" href="styles.css">
    <style>
        /* 与login.html相似的样式 */
        .container { padding: 20px; }
        .login-card {
            background: white;
            border-radius: 20px;
            padding: 30px 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }
        /* 其他样式复用login.html */
    </style>
</head>
<body>
    <div class="container">
        <a href="home.html" class="back-btn">
            <i class="fas fa-arrow-left"></i>
        </a>

        <div class="login-card">
            <div class="logo">
                <img src="image/28.jpg" alt="Logo">
            </div>

            <div class="welcome-text">
                <h1>欢迎注册</h1>
                <p>创建您的动漫世界账号</p>
            </div>

            <form id="registerForm">
                <div class="input-group">
                    <label>用户名</label>
                    <input type="text" id="username" class="input-field" placeholder="请输入用户名" required>
                </div>

                <div class="input-group">
                    <label>密码</label>
                    <input type="password" id="password" class="input-field" placeholder="请输入密码" required>
                </div>

                <button type="submit" class="btn">注册</button>
                <div class="switch-form">
                    已有账号？<a href="login.html">点击登录</a>
                </div>
            </form>
        </div>
    </div>
    <script>
        document.getElementById('registerForm').addEventListener('submit', function(event) {
            event.preventDefault();
            const username = document.getElementById('username').value;
            const password = document.getElementById('password').value;
            
            // 存储用户信息
            localStorage.setItem(username, password);
            alert('注册成功！');
            window.location.href = 'login.html';
        });
    </script>
</body>
</html>